import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:sui_shou_pai/module/top_bar.dart';
import 'package:sui_shou_pai/my/comments/commented_photo_records_list.dart';

import 'comments/commented_announcement_list.dart';
import 'comments/commented_news_list.dart';

class MyComment extends StatefulWidget {
  @override
  _MyCommentState createState() => _MyCommentState();
}

class _MyCommentState extends State<MyComment> with TickerProviderStateMixin {
  List<Tab> tabLabels = [
    Tab(text: '新闻'),
    Tab(text: '公告'),
    Tab(text: '照片'),
  ];

  TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: tabLabels.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("我的评论"),
        bottom: initTabBar(tabLabels, _tabController),
      ),
      body: TabBarView(
        controller: _tabController,
        children: <Widget>[
          CommentedCompanyNewsList(),
          CommentedAnnouncementList(),
          CommentedPhotoRecordList(),
        ],
      ),
    );
  }
}
